Imports System.Data.SqlClient

Public Class NotasDePedidos
    Public Function ObtenerINP(Estado As String)
        Dim DS As DataSet
        DS = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(My.Settings.MiCadena, "ItemsDeNPObtener", Estado)
        Return DS
    End Function

    Public Function ObtenerINPConPEE(ByVal Estado As String, ByVal VPG As Long, ByVal TNP As Long, ByVal TPE As Long, ByVal CodClasificacion As Integer)
        Dim DS As DataSet
        DS = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(My.Settings.MiCadena, "ItemsDeNPObtenerConPEE", Estado, VPG, TNP, TPE, CodClasificacion)
        Return DS
    End Function

    Public Function GenerarNP(ByVal CanTotNP, ByVal FecNP, ByVal ObsNP)
        Dim DS As New DataSet
        DS = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(My.Settings.MiCadena, _
        CommandType.StoredProcedure, "NotaDePedidoGenerar", New SqlParameter("@CanTotNP", CanTotNP), _
        New SqlParameter("@FecNP", FecNP), New SqlParameter("@ObsNP", ObsNP))
        Return DS
    End Function

    Public Function GenerarINP(ByVal CodINP, ByVal CodPro, ByVal CodCli, ByVal CanINP, ByVal FecEntINP, ByVal ObsINP)
        Dim DS As New DataSet
        DS = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(My.Settings.MiCadena, _
        CommandType.StoredProcedure, "ItemsDeNPGenerar", New SqlParameter("@CodINP", CodINP), _
        New SqlParameter("@CodPro", CodPro), New SqlParameter("@CodCli", CodCli), _
        New SqlParameter("@CanINP", CanINP), New SqlParameter("@FecEntINP", FecEntINP), _
        New SqlParameter("@ObsINP", ObsINP))
        Return DS
    End Function

    Public Function ModificarINP(ByVal CodINP)
        Dim DS As New DataSet
        DS = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(My.Settings.MiCadena, _
        CommandType.StoredProcedure, "ItemsDeNPModificar", New SqlParameter("@CodINP", CodINP))
        Return DS
    End Function

    Public Sub ItemsDeNPReservar(ByVal CodINP, ByVal CodIPP)
        Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteScalar(My.Settings.MiCadena, "ItemsDeNPReservar", CodINP, CodIPP)
    End Sub
End Class
